package com.yzy.demo;

public class Progress {
    //到达时间
    public int arriveTime;
    //运行时间
    public int runTime;
    //完成时间
    public int finishTime;
    //周转时间
    public int totalTime;
    //带权周转时间
    public float weightTotalTime;
    //进程名
    public String name;

    public Progress() {
    }

    public Progress(String name, int arriveTime, int runTime){
        this.name = name;
        this.arriveTime = arriveTime;
        this.runTime = runTime;
    }

    //获得周转时间
    public void getTotalTime(){

        totalTime = finishTime - arriveTime;
    }
    //获得带权周转时间
    public void getWeightTotalTime(){
        weightTotalTime = (float)totalTime/runTime;
    }

    //打印结果
    @Override
    public String toString() {
        return name+"到达时间："+arriveTime+"运行时间："+runTime+"完成时间："+finishTime+"周转时间："+totalTime+"带权周转时间："+weightTotalTime;
    }

}
